package com.bocloud.cmp.dao;

import java.util.List;
import java.util.Map;

import com.bocloud.cmp.entity.resource.Network;
import com.bocloud.common.model.Param;
import com.bocloud.common.model.SimpleBean;
import com.bocloud.database.core.intf.GenericDao;

/**
 * 网络DAO接口
 * 
 * @author dongkai
 *
 */
public interface NetworkDao extends GenericDao<Network, Long> {

	/**
	 * 列表展示
	 * 
	 * @param page
	 * @param rows
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<Network> list(int page, int rows, List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 简易查询
	 * 
	 * @param params
	 * @param sorter
	 * @return
	 * @throws Exception
	 */
	public List<SimpleBean> list(List<Param> params, Map<String, String> sorter) throws Exception;

	/**
	 * 查询所有
	 * 
	 * @return
	 * @throws Exception
	 */
	public List<Network> listByVid(Long vendorId) throws Exception;

	/**
	 * 查询数量
	 * 
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params) throws Exception;

	/**
	 * 删除
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public boolean remove(Long id, Long userId) throws Exception;

	/**
	 * 根据云供应商ID删除
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public boolean removeByVid(Long vendorId, Long userId) throws Exception;

	/**
	 * 根据ID查询
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Network query(Long id) throws Exception;

	/**
	 * 根据网络ID查询
	 * 
	 * @param networkId
	 * @return
	 * @throws Exception
	 */
	public Network getByNetId(String networkId) throws Exception;

	/**
	 * 根据数据中心ID查询
	 * 
	 * @param vdcId
	 * @return
	 * @throws Exception
	 */
	public List<Network> listByVdc(Long vdcId) throws Exception;

	/**
	 * 根据数据中心ID删除
	 * 
	 * @param vendorId
	 * @return
	 * @throws Exception
	 */
	public boolean removeByVdc(Long vdcId, Long userId) throws Exception;

	/**
	 * 数量
	 * 
	 * @param params
	 * @param type
	 * @return
	 * @throws Exception
	 */
	public int count(List<Param> params, String type) throws Exception;
}
